package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TemperatureSensorMapper;
import com.ruoyi.system.domain.TemperatureSensor;
import com.ruoyi.system.service.ITemperatureSensorService;

/**
 * 温度传感器数据Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-10-28
 */
@Service
public class TemperatureSensorServiceImpl implements ITemperatureSensorService 
{
    @Autowired
    private TemperatureSensorMapper temperatureSensorMapper;

    /**
     * 查询温度传感器数据
     * 
     * @param id 温度传感器数据主键
     * @return 温度传感器数据
     */
    @Override
    public TemperatureSensor selectTemperatureSensorById(Long id)
    {
        return temperatureSensorMapper.selectTemperatureSensorById(id);
    }

    /**
     * 查询温度传感器数据列表
     * 
     * @param temperatureSensor 温度传感器数据
     * @return 温度传感器数据
     */
    @Override
    public List<TemperatureSensor> selectTemperatureSensorList(TemperatureSensor temperatureSensor)
    {
        return temperatureSensorMapper.selectTemperatureSensorList(temperatureSensor);
    }

    /**
     * 新增温度传感器数据
     * 
     * @param temperatureSensor 温度传感器数据
     * @return 结果
     */
    @Override
    public int insertTemperatureSensor(TemperatureSensor temperatureSensor)
    {
        temperatureSensor.setCreateTime(DateUtils.getNowDate());
        return temperatureSensorMapper.insertTemperatureSensor(temperatureSensor);
    }

    /**
     * 修改温度传感器数据
     * 
     * @param temperatureSensor 温度传感器数据
     * @return 结果
     */
    @Override
    public int updateTemperatureSensor(TemperatureSensor temperatureSensor)
    {
        return temperatureSensorMapper.updateTemperatureSensor(temperatureSensor);
    }

    /**
     * 批量删除温度传感器数据
     * 
     * @param ids 需要删除的温度传感器数据主键
     * @return 结果
     */
    @Override
    public int deleteTemperatureSensorByIds(Long[] ids)
    {
        return temperatureSensorMapper.deleteTemperatureSensorByIds(ids);
    }

    /**
     * 删除温度传感器数据信息
     * 
     * @param id 温度传感器数据主键
     * @return 结果
     */
    @Override
    public int deleteTemperatureSensorById(Long id)
    {
        return temperatureSensorMapper.deleteTemperatureSensorById(id);
    }
}
